<!DOCTYPE html>
<html>
<head>
    <% include ../common/meta.ejs %>
    <% include ../common/public.ejs %>
    <link href="<%= global.config.publicPath %>/page/css/print.css" type="text/css" rel="stylesheet">
    <style>
        .form-control, .select2-search input[type="text"] {
            height: 34px;
            border: 1px solid #ccc;
        }
    </style>
</head>
<body>
<% include ../common/header.ejs %>
<div class="container">
    <div class="dolphin-row main page-content">
        <div class="page-header">
            <h5 class="content-title">水电气抄表
                <span style="font-size: 50%;">每月抄表一次</span>
            </h5>
        </div>
        <%
        var now = new Date();
        var d1 = now.setDate(1);
        var d2 = now.setMonth(now.getMonth() - 1);
        var d3 = now.setMonth(now.getMonth() - 1);
        var dd1 = global.tool.dateFormatter(new Date(d1), 'yyyy-MM');
        var dd2 = global.tool.dateFormatter(new Date(d2), 'yyyy-MM');
        var dd3 = global.tool.dateFormatter(new Date(d3), 'yyyy-MM');
        %>
        <div class="queryCondition">
            <form class="query-form form-inline">
                <div class="row">
                    <div class="col-md-3">
                        <div class="form-group">
                            <label>抄表日期：</label>
                            <select name="meterDate" style="width: 180px;" id="meterDateSelect">
                                <option value="<%= dd1 %>"><%= dd1 %></option>
                                <option value="<%= dd2 %>"><%= dd2 %></option>
                                <option value="<%= dd3 %>"><%= dd3 %></option>
                            </select>
                        </div>
                    </div>
                </div>
                <input type="hidden" id="meterYear" name="meterYear"/>
                <input type="hidden" id="meterMonth" name="meterMonth"/>
            </form>
        </div>
        <div class="panel panel-primary">
            <div class="panel-heading">
                <div class="panel-title">
                    <h3 class="panel-title">
                        <i aria-hidden="true" class="fa fa-table fa-lg"></i>
                        水电费抄表
                    </h3>
                    <div class="operationButton" style="float: right;margin-top:-26px;margin-right: -15px;">
                        <button type="button" class="btn btn-warning btn-sm" id="batchGenBill">
                            <i class="fa fa-money"></i>
                            生成账单
                        </button>
                        <a href="javascript:void(0);" class="btn btn-danger btn-sm" id="printBill">
                            <i class="fa fa-print"></i>
                            打印抄表单
                        </a>
                    </div>
                </div>
            </div>
            <div id="dataList"></div>
        </div>
    </div>
</div>
<div class="modal fade" id="printModal" tabindex="-1" role="dialog" aria-labelledby="printModalLabel">
    <div class="modal-dialog" role="document" style="top: 0;left: 20%;width: 720px;">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span
                            aria-hidden="true">&times;</span></button>
                <h4 class="modal-title" id="printModalLabel"><span id="billMonth"></span>水电抄表单</h4>
            </div>
            <div class="modal-body printContent" id="printContent">

            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-primary printContract">打印</button>
                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
            </div>
        </div>
    </div>
</div>
<% include ../common/footer.ejs %>
</body>
</html>